﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using CommunicationProtocol.dto.game;

namespace CommunicationProtocol.dto
{
    public class PlantFactory
    {
        public static DynamicPlant fromObjectType(short objectId, byte objectType, byte xLocation, byte yLocation) {

            if (objectType == 1)
            {
                return new PeaShooter(objectId, xLocation, yLocation);
            }
            else if (objectType == 2) { 
                return new SunFlower(objectId, xLocation, yLocation);
            }
            throw new ArgumentException("不支持");
        }

    }
}
